package com.practise.beanconf.annotation;

import com.practise.beanconf.annotation.model.People;
import com.practise.beanconf.annotation.model.PeopleConfig;
import com.practise.beanconf.annotation.model.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;


@SpringBootApplication
@Slf4j
public class App implements ApplicationRunner {

    @Autowired
    People people;

    @Autowired
    PeopleConfig peopleConfig;

    @Autowired
    User user;

    public static void main(String[] args) {
        SpringApplication.run(App.class,args);
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        log.info("pepole bean from auto anntotaion : {}", people.toString());
        log.info("peopleConfig bean from auto anntotaion : {}", peopleConfig.toString());
        log.info("user info is : {}",user.toString());
    }
}
